<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title th:text="${article ne null?article.getArticletitle():'EasyShare-Content'}">EasyShare-Content</title>
    <link rel="icon" href="/favicon.ico" th:href="@{/favicon.ico}" sizes="32x32">
    <link href="/css/main/bootstrap.min.css" th:href="@{/css/main/bootstrap.min.css}" rel="stylesheet">
    <link href="/css/main/index-style.css" th:href="@{/css/main/index-style.css}" rel="stylesheet">
    <link href="/css/main/index-nprogress.css" th:href="@{/css/main/index-nprogress.css}" rel="stylesheet">
    <link href="/css/main/sidebar-canvi.css" th:href="@{/css/main/sidebar-canvi.css}" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="/js/main/html5shiv.min.js" type="text/javascript" th:href="@{/js/main/html5shiv.min.js}"></script>
    <script src="/js/main/respond.min.js" type="text/javascript" th:href="@{/js/main/respond.min.js}"></script>
    <script src="/js/main/selectivizr-min.js" type="text/javascript" th:href="@{/js/main/selectivizr-min.js}"></script>
    <![endif]-->
    <meta name="Keywords" content=""/>
    <meta name="description" content=""/>
    <style type="text/css">
        img.fr-fil {
            float: left;
        }

        img.fr-fir {
            float: right;
        }

        pre {
            text-indent: 0em;
        }
    </style>
    <script type="text/javascript">
        //判断浏览器是否支持HTML5
        /*window.onload = function () {
            if (!window.applicationCache) {
                window.location.href = "ie.html";
            }
        }*/
    </script>
</head>

<body>
<input type="hidden" id="tip1" th:value="${tip}">
<aside th:replace="~{commons/sidebar :: sidebar}"></aside>
<section class="container">
    <header th:replace="~{commons/leftbar :: leftbar}"></header>
    <!--/超小屏幕可见-->
    <div class="content-wrap"><!--内容-->
        <div class="content">
            <header class="news_header">
                <input type="hidden" id="aid" th:value="${article.getArticleid()}">
                <h2 th:text="${article.getArticletitle()}">欢迎来到EasyShare技术博客</h2>
                <ul>
                    <li>[[${article.getArticleauthor()}]] 发布于
                        [[${#dates.format(article.getArticlecreatetime(),'yyyy-MM-dd HH:mm:ss')}]]
                    </li>
                    <li>栏目：<a href="javascript:;" target="_blank"
                              th:if="${article.getArticlecolumn()==1}">网站前端</a>
                        <a href="javascript:;" target="_blank"
                           th:if="${article.getArticlecolumn()==2}">网站后端</a>
                        <a href="javascript:;" target="_blank"
                           th:if="${article.getArticlecolumn()==3}">资源分享</a>
                        <a href="javascript:;" target="_blank"
                           th:if="${article.getArticlecolumn()==4}">其他内容</a>
                    </li>
                    <li>来源：<a href="javascript:;"
                              th:href="${article.getArticlesourcehref() ne null?article.getArticlesourcehref():'javascript:;'}"
                              th:text="${article.getArticlesource()}">互联网</a></li>
                    <li>共 <strong th:text="${article.getArticleaudiences()}" title="此处仅统计本站用户">xx</strong> 人围观</li>
                </ul>
            </header>
            <article class="news_content" th:utext="${article.getArticlecontent()}"></article>
            <div class="reprint">转载请说明出处：<a href="/" title="EasyShare" target="_blank">EasyShare技术博客</a>
                » <a href="#"
                     title="EasyShare"
                     target="_blank"
                     th:text="${#strings.abbreviate(article.getArticletitle(),20)}">Title</a>
            </div>
            <div class="zambia" th:if="${session.user eq null}"><a href="/page/noLogin?tip=请先登录" name="zambia"><span
                    class="glyphicon glyphicon-thumbs-up"></span> 赞（[[${supportCount}]]）</a>
            </div>
            <div class="zambia" th:if="${session.user ne null}"><a href="javascript:;" name="zambia" id="zambia"
                                                                   th:if="${isSupport==0}"><span
                    class="glyphicon glyphicon-thumbs-up"></span> 赞（[[${supportCount}]]）</a>
                <a href="javascript:;" th:if="${isSupport==1}"><span class="glyphicon glyphicon-thumbs-up"></span>
                    已赞</a>
            </div>
            <input type="hidden" id="supportUids" th:value="${article.getArticlesupport()}">
            <div class="tags news_tags">标签： <span th:each="tag:${tags}" data-toggle="tooltip" data-placement="top"><a
                    href="javascript:;" th:href="'/article/toRelevant/'+${tag.getTagname()}"
                    th:text="${tag.getTagname()}" target="_blank">TagName</a></span></div>
            <nav class="page-nav"> <span class="page-nav-prev" th:if="${prevArticle ne null}">上一篇<br/>
        <a href="/article/show" th:href="'/article/show/'+${prevArticle.getArticleid()}"
           th:text="${prevArticle.getArticletitle()}">欢迎来到EasyShare技术博客</a></span> <span
                    class="page-nav-next" th:if="${nextArticle ne null}">下一篇<br/>
        <a href="/article/show" th:href="'/article/show/'+${nextArticle.getArticleid()}"
           th:text="${nextArticle.getArticletitle()}">欢迎来到EasyShare技术博客</a></span></nav>
            <div class="content-block related-content visible-lg visible-md">
                <h2 class="title"><strong>猜你喜欢</strong></h2>
                <ul>
                    <li th:each="re:${recomment}"><a target="_blank" href="/article/show"
                                                     th:href="'/article/show/'+${re.getArticleid()}"><img
                            src="/img/main/logo.jpg" th:src="${re.getArticlecover()}" th:title="${re.getArticletitle()}"
                            alt="ArticleImg">
                        <h3 th:text="${re.getArticletitle()}"> 欢迎来到EasyShare技术博客,在这里可以看到网站前端和后端的技术等 </h3>
                    </a></li>
                </ul>
            </div>
            <div class="content-block comment">
                <h2 class="title"><strong>最新评论</strong></h2>
                <form action="/comment/add" method="post" class="form-inline" id="comment-form">
                    <div class="comment-title">
                    </div>
                    <div class="comment-form">
                        <textarea placeholder="请先登录" name="commentcontent"
                                  th:if="${session.user eq null}" readonly></textarea>
                        <textarea placeholder="此处编写评论" name="commentcontent"
                                  th:if="${session.user ne null}"></textarea>
                        <div class="comment-form-footer">
                            <input type="hidden" name="aid" th:value="${article.getArticleid()}">
                            <div class="comment-form-text" th:if="${session.user ne null}"
                                 style="color: deepskyblue;font-weight: bolder">您将以<span
                                    style="color: green" th:text="${session.user.getUsername()}"></span>的身份进行提交
                            </div>
                            <div class="comment-form-text" th:if="${session.user eq null}"
                                 style="font-weight: bolder">
                                请先<a href="/page/toLogin" target="_self" style="color: #2c82c9"
                                     onmousemove="this.style='color:deepskyblue'"
                                     onmouseleave="this.style='color:#2c82c9'">登录</a>(登陆后才可以进行留言)
                            </div>
                            <div class="comment-form-btn" th:if="${session.user ne null}">
                                <button type="submit" class="btn btn-default btn-comment">提交留言</button>
                            </div>
                            <div class="comment-form-btn" th:if="${session.user eq null}">
                                <button type="button" class="btn btn-default btn-comment">提交留言</button>
                            </div>
                        </div>
                    </div>
                </form>
                <div class="comment-content">
                    <ul>
                        <li th:if="${comments.size()==0}"><span class="face"><img src="/userImages/5.gif"
                                                                                  alt="UserImg"></span>
                            <span class="text"><strong>EasyShare站长</strong>说：<br/>这篇文章还没有人评论呢，快来抢沙发吧！</span>
                        </li>
                        <li th:each="comment:${comments}"><span class="face"><img src="/img/main/icon/icon.png"
                                                                                  th:src="${comment.getCommentuserimg()}"
                                                                                  alt="UserImg"></span>
                            <span class="text"><strong th:text="${comment.getCommentusername()}">xxx</strong> ([[${#dates.format(comment.getCommenttime(),'yyyy-MM-dd HH:mm:ss')}]]) 说：<br/>[[${comment.getCommentcontent()}]]</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!--/内容-->
    <div th:replace="~{commons/rightbar :: rightbar}"></div>
    <!--/右侧>992px显示-->
    <footer th:replace="~{commons/footer :: footer}"></footer>
</section>
<div><a href="javascript:;" class="gotop" style="display:none;"></a></div>
<!--/返回顶部-->
<script src="/js/jquery-3.1.1.min.js" type="text/javascript" th:src="@{/js/jquery-3.1.1.min.js}"></script>
<script src="/js/main/bootstrap.min.js" type="text/javascript" th:src="@{/js/main/bootstrap.min.js}"></script>
<script src="/js/main/nprogress.js" type="text/javascript" th:src="@{/js/main/nprogress.js}"></script>
<script src="/js/main/index-code.js" type="text/javascript" th:src="@{/js/main/index-code.js}"></script>
<script type="text/javascript">
    $(function () {
        var tip = $("#tip1").val();
        if (tip.trim() != "") {
            alert(tip);
        }
        $("a#zambia").click(function () {
            $.ajax({
                type: "POST",
                url: "/article/addSupport",
                data: {uids: $("input#supportUids").val(), aid: parseInt($("input#aid").val())},
                dataType: "json",
                async: false,
                success: function (data) {
                    if (data.flag == "true") {
                        $("input[name='zambia']").removeAttr("id");
                        alert("您已点赞成功");
                        location.reload();
                    } else if (data.flag == "false") {
                        alert("点赞异常，如有影响请联系站长");
                    }
                }
            });
        });
    });
</script>
</body>
</html>
